package controller;

import view.GameJPanel;
import view.UI;

import javax.swing.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class WinLis extends WindowAdapter {
    @Override
    public void windowClosing(WindowEvent e){

        int result = JOptionPane.showConfirmDialog(null, "确定退出吗", "请做出一个选择", JOptionPane.YES_NO_OPTION);

        if(result == JOptionPane.YES_OPTION){
            GameJPanel.cardLayout.show(GameJPanel.cardPanel, "游戏界面");
            UI.gameJFrame.setVisible(true);
            UI.enterGameJFrame.setVisible(false);
        }

    }
}
